Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #221 - Use nextPageToken to list all snapshots #222

Merged
merged 1 commit into from
May 23, 2017
Merged

Conversation

imriz
Copy link
Contributor

@imriz imriz commented May 18, 2017

No description provided.

api_method = @compute.snapshots.list
project = @project if project.nil?
parameters = {
"project" => project
"project" => project,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use 2 spaces for indentation in a hash, relative to the start of the line where the left curly brace is.

data = service.list_snapshots(nil, next_page_token)
items.concat(data.body["items"])
next_page_token = data.body['nextPageToken']
end until next_page_token.nil? || next_page_token.empty?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Kernel#loop with break rather than begin/end/until(or while).

begin
data = service.list_snapshots(nil, next_page_token)
items.concat(data.body["items"])
next_page_token = data.body['nextPageToken']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@icco
Copy link
Member

icco commented May 23, 2017

Seems straight forward! Thanks @imriz!

@icco icco merged commit 51ef5bf into fog:master May 23, 2017
agrare added a commit to agrare/manageiq-providers-google that referenced this pull request Jun 2, 2017
PR fog/fog-google#222 broke snapshot listing in
our vcr cassettes which was released in 0.5.3.  Lock down fog-google to
0.5.2 until we re-record the cassette.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants